package com.ayelet.learnenglish;

import java.util.ArrayList;

import android.support.v7.app.ActionBarActivity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;


public class LearnEnglish extends ActionBarActivity {

	private ArrayList<ImageAndLabel> alList;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_learn_english);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.learn_english, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
    
    public void NextImage(View vSourceView)
    {
    	// Getting random image
    	//int nNextImageResource = GetResourceByUri(uNextImage);
    	
    	ImageView ivImageView = (ImageView) findViewById(R.id.ivImageView);
    	
    	// Setting the new image
    	ivImageView.setImageResource(R.drawable.a);
    }
    
    public void Echo(View vSourceView)
    {
    	
    }
    
    private int GetResourceByUri(Uri uImageName)
    {
    	final String PATH = "@drawable/";
    	
    	String strFullPath = PATH + uImageName;
    	int Result = getResources().getIdentifier(strFullPath, null, getPackageName());
    	
    	return (Result);
    }
}
